//package com.plian.system.controller.pf;
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.plian.Tools.CollectionUtil;
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.Tools.pagedata.PageData;
//import com.plian.system.config.Resubmit;
//import com.plian.system.dto.pf.BaseDeputyDifferentDTO;
//import com.plian.system.entity.pf.BaseDeputyDifferent;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.pf.IBaseDeputyDifferentService;
//import com.plian.system.service.wf.FormWorkflowService;
//import com.plian.system.vo.pf.BaseDeputyDifferentVO;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.AllArgsConstructor;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.validation.Valid;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
///**
// * @Description: TODO
// * @Author: Take-off
// * @Date: 2023/3/10 5:48 PM
// * @Param
// * @return
// * @Version: 1.0
// **/
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/deputdifferent")
//@Api(value = "BaseDeputyDifferentController", tags = "企业副职差异化考核得分及分配系数 控制器")
//public class BaseDeputyDifferentController extends BaseController {
//
//    private FormWorkflowService formWorkflowService;
//
//    private IBaseDeputyDifferentService baseDeputyDifferentService;
//
//    @PostMapping("/detail")
//    @ApiOperation(value = "详情", notes = "传入 baseBusinessAudit")
//    public R<BaseDeputyDifferentVO> detail(@RequestBody BaseDeputyDifferent baseDeputyDifferent) {
//        return baseDeputyDifferentService.getDetailObj(baseDeputyDifferent);
//    }
//
//    @PostMapping("/list")
//    @ApiOperation(value = "分页", notes = "传入query")
//    public ListResult<BaseDeputyDifferentVO> list(@RequestBody Query query) {
//        return baseDeputyDifferentService.list(query);
//    }
//
//    @PostMapping("/submit")
//    @Resubmit(delaySeconds = 0)
//    @ApiOperation(value = "新增或修改", notes = "传入 baseBusinessAudit")
//    public R<BaseDeputyDifferent> submit(@Valid @RequestBody BaseDeputyDifferent baseDeputyDifferent) {
//
//        boolean result = baseDeputyDifferentService.submit(baseDeputyDifferent);
//        HashMap<String, Object> processVariable = new HashMap<>();
//        formWorkflowService.startProcessAndSimulate(String.valueOf(baseDeputyDifferent.getId()),baseDeputyDifferent.getFormType(),processVariable);
//
//        return result ? R.data(baseDeputyDifferent) : new R(CommonCode.FAIL);
//    }
//
//    @PostMapping("/remove")
//    @ApiOperation(value = "删除", notes = "传入 ids")
//    public R remove(@RequestBody PageData pd) {
//        List<String> ids = (List<String>)pd.get("ids");
//        return baseDeputyDifferentService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA)))
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//
//    @PostMapping("/mapDetails")
//    @Resubmit(delaySeconds = 0)
//    @ApiOperation(value = "根据时间区间获取详情", notes = "传入 时间区间")
//    public R<List<Map<String, Object>>> getMapDetails( @RequestBody BaseDeputyDifferentDTO dto) {
//        List<BaseDeputyDifferent> list = baseDeputyDifferentService.list(new LambdaQueryWrapper<BaseDeputyDifferent>().eq(BaseDeputyDifferent::getFillingUnitId,dto.getFillingUnitId())
//                .eq(BaseDeputyDifferent::getDeclareYear, dto.getDeclareYear()));
//        if (CollectionUtil.isNotEmpty(list)){
//            return R.fail("任期激励年度区间重复") ;
//        }else {
//            List<Map<String, Object>> mapDetails = baseDeputyDifferentService.getMapDetails(dto.getOfficeYearStart(), dto.getOfficeYearEnd());
//            return R.data(mapDetails) ;
//        }
//
//    }
//
//}
